﻿using System.Collections.Generic;
using HMIS.FrameWork.DomainBase;
using HMIS.Infrastructure.Core.Authority;
using HMIS.Infrastructure.Core.Repositories;

namespace HMIS.Infrastructure.Facade.Authority.Impl
{
    public class DepartmentFacadeImpl : IDepartmentFacade
    {
        private readonly IDepartmentRepository DepartmentRepository;
        public DepartmentFacadeImpl(IDepartmentRepository DepartmentRepository)
        {
            this.DepartmentRepository = DepartmentRepository;
        }
        #region IDepartmentFacade 成员

        public IList<Department> GetPlist(int start, int limit, string sort, string dir, List<DataFilter> filters, out long total)
        {
            return DepartmentRepository.GetPlist(start, limit, sort, dir, filters, out total);
        }

        public bool IsFieldExist(string fieldName, string fieldValue, string id)
        {
            return DepartmentRepository.IsFieldExist(fieldName, fieldValue, id);
        }

        public void SaveOrUpdate(Department entity)
        {
            DepartmentRepository.SaveOrUpdate(entity);
        }

        public void Delete(string id)
        {
            DepartmentRepository.Delete(id);
        }

        public Department Get(string id)
        {
            return DepartmentRepository.Get(id);
        }

        public Department Load(string id)
        {
            return DepartmentRepository.Load(id);
        }

        public IList<Department> QueryPlist(string query, int start, int limit, out long total)
        {
            return DepartmentRepository.QueryPlist(query, start, limit, out total);

        }
        #endregion
    }
}
